/*
 * @Author: ZhangXiaodong
 * @Date: 2025-04-14 23:13:51
 * @LastEditors: ZhangXiaodong
 * @LastEditTime: 2025-04-24 00:21:08
 * @Description: 数据模型
 * @FilePath: /blog-ost/src/model/ResModel.js
 */
class ResModel {
    constructor(data,msg){
        if(typeof data === 'string'){
            this.msg = data
            this.data = null
            return
        }
        this.data = data || null;
        this.msg = msg || '操作成功'
    }
}
class SuccessModel extends ResModel {
    constructor(data,msg){
        super(data,msg)
        this.errorCode = 0
    }
}

class ErrorModel extends ResModel {
    constructor(data,errorCode = -1){
        super(data)
        this.errorCode = errorCode
    }
}
module.exports  = {
    SuccessModel,
    ErrorModel
}

